import React, {PureComponent} from 'react'
import {View, Image, StyleSheet, TouchableOpacity, Text, Dimensions, Button, Platform} from 'react-native'
const {width} = Dimensions.get('window')


type Props = {
    navigation:any,
    info: Object,
    onPress:Function,
}
export default class ZiliaoCell extends PureComponent<Props>{

    render(){

        let lesson = this.props.info.item
        let index = this.props.info.index

        return <TouchableOpacity onPress={()=>{this.props.onPress()}} style={{flexDirection:'row',paddingTop:15,paddingBottom:15,backgroundColor:'#F8F8F8',marginLeft:12,marginRight:12,alignItems:'center',borderRadius:4,}}>
            <Text numberOfLines={1} style={{color:'#333333',fontSize:13,marginRight:10,marginLeft:15,maxWidth:(width - 130)}}>{index+1}：{lesson.title}</Text>
            <View style={{flex:1}}/>
            <View style={{width:67,height:20,backgroundColor:'#db3843',borderRadius:10,justifyContent:'center',alignItems:'center',marginRight:15}}>
                <Text style={{fontSize:12,color:'#FFFFFF',}}>查看详情</Text>
            </View>
        </TouchableOpacity>
    }
}